package com.shixun.blog.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shixun.blog.mapper.BlogArticleMapper;
import com.shixun.blog.domain.BlogArticle;
import com.shixun.blog.service.IBlogArticleService;
import com.shixun.common.core.text.Convert;

/**
 * 博客Service业务层处理
 * 
 * @author shixun
 * @date 2023-12-27
 */
@Service
public class BlogArticleServiceImpl implements IBlogArticleService 
{
    @Autowired
    private BlogArticleMapper blogArticleMapper;

    /**
     * 查询博客
     * 
     * @param id 博客主键
     * @return 博客
     */
    @Override
    public BlogArticle selectBlogArticleById(Long id)
    {
        return blogArticleMapper.selectBlogArticleById(id);
    }

    /**
     * 查询博客列表
     * 
     * @param blogArticle 博客
     * @return 博客
     */
    @Override
    public List<BlogArticle> selectBlogArticleList(BlogArticle blogArticle)
    {
        return blogArticleMapper.selectBlogArticleList(blogArticle);
    }

    /**
     * 新增博客
     * 
     * @param blogArticle 博客
     * @return 结果
     */
    @Override
    public int insertBlogArticle(BlogArticle blogArticle)
    {
        return blogArticleMapper.insertBlogArticle(blogArticle);
    }

    /**
     * 修改博客
     * 
     * @param blogArticle 博客
     * @return 结果
     */
    @Override
    public int updateBlogArticle(BlogArticle blogArticle)
    {
        return blogArticleMapper.updateBlogArticle(blogArticle);
    }

    /**
     * 批量删除博客
     * 
     * @param ids 需要删除的博客主键
     * @return 结果
     */
    @Override
    public int deleteBlogArticleByIds(String ids)
    {
        return blogArticleMapper.deleteBlogArticleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除博客信息
     * 
     * @param id 博客主键
     * @return 结果
     */
    @Override
    public int deleteBlogArticleById(Long id)
    {
        return blogArticleMapper.deleteBlogArticleById(id);
    }
}
